<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<h1>图书管理</h1>


<form action="/books/manage" method="post">
    <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
    作者：</label></lab><input type="text" name="author" placeholder="请输入作者名称"><br>
    书籍：<input type="text" name="book" placeholder="请输入书籍名称"><br>
    <input type="submit" value="添加"><br>
</form>


{% for message in get_flashed_messages() %}
    {{ message }}
{% endfor %}


<hr>

<ul>
    {% for author in authors %}
        <li>{{ author.name }}<a href="/delete_author/{{ author.id }}">删除</a></li>
        <ul>
        {% for book in author.books %}
            <li>{{ book.name }}<a href="/delete_book/{{ book.id }}">删除</a></li></li>
        {% endfor %}
        </ul>
    {% endfor %}
</ul>

</body>
</html>